#include "speed_buff.h"

/**
 * 09/03/12 - Steven Hartin - Original Creation
 */

CSpeedBuff::CSpeedBuff()
    : CBuff(ENT_BUFF_SPEED, "speedbuff", BUFF_TYPE_BUFF)
{
}

bool CSpeedBuff::applyBuff(CPlayer *pPlayer)
{
    /**
     * Applies the speed buff to a player. We just want to increment the
     * player's speed.
     *
     * @param CPlayer *pPlayer A pointer to the player to apply the buff to.
     */
    pPlayer->setSpeed(pPlayer->getSpeed() + Constants::BUFF_SPEED_INCREASE);
    return true;
}

bool CSpeedBuff::removeBuff(CPlayer *pPlayer)
{
    /**
     * Removes the speed buff from a player. We just want to decrease the
     * player's speed.
     *
     * @param CPlayer *pPlayer A pointer to the player to remove the buff from.
     */
    pPlayer->setSpeed(pPlayer->getSpeed() - Constants::BUFF_SPEED_INCREASE);
    return true;
}